<template>
	<view>
        <u-popup :show="show" mode="bottom"  @close="closeShow" :round="23">
			<div>
				<div class="popupTitle" style="text-align: left;padding-left:16px;">
					<img src="https://pic.moresu.com/FvrReiN9BLYzIoiRyQJ6ih2RM64J" style="width:15px;height:17px;display: inline-block;vertical-align: middle;"/>
					<span style="padding-left:20rpx;vertical-align: middle;">选择颜色</span>
					<div style="color:#FF5E01;font-size:28rpx;float:right;margin-right:32rpx;font-weight: 400"  @click="black">返回上一级</div>
				</div>
				<div class="popup-con" style="padding:0 24px 16px 24px;margin-top:10px">
					 <u-radio-group v-model="value" :borderBottom="true" placement="column" iconPlacement="right" >
						<u-radio :customStyle="{marginBottom: '16px'}" v-for="(item, index) in list" :key="index" :label="item" :name="item" >
						</u-radio>
					 </u-radio-group>
					 
				</div>
				<div style="width:100%;padding:24rpx;bottom:0;background: #fff;border-top:1px solid #eee">
				  <u-button text="确认" shape="circle" type="primary" @click="save"></u-button>
				</div>
			</div>
        </u-popup>
	</view>
</template>
<script>

import{imgCheck} from '@/plugins/upload/upload.js'
import {getSpecList} from '@/config/api.js'
import store from '@/store';
const log = require('@/plugins/log.js')

export default {
    name: 'chooseColor',
 
	mounted() {
	 
	},
	data() {
		return {
			height:'',
            show:false,
			value:'',
			list:[],
			categoryId:''
	
		}
	},
    watch:{

    },
	
	created() {
	
	},
	methods: {
		black(){
		   this.$emit('blackCategory')
		},
		init(color,categoryId){
			this.show = true;
			this.value = color;
			this.categoryId = categoryId;
			getSpecList({categoryId:this.categoryId,specCode:'goodsColor'}).then((res)=>{
				this.list = res;
			})
		},
       save(){
		   if(this.value!= ''){
			  log.info('颜色弹窗颜色&'+this.value)
			  this.$emit('chooseItem',this.value)
			  this.show = false
			}else{
			   uni.showToast({
				 title: '请选择颜色',
				 duration: 1000,
				 icon: 'none'
			   })
		   }
	   },
	   closeShow(){
		   this.show = false
	   }
          
	}
};
</script>

<style lang="scss" scoped>
@import '@/style/common.scss';
.popupTitle{
	font-size:$b-font;
	font-weight: bold;
	text-align: center;
	line-height: 50px;
}
   .popup-con{
    	padding:0 16px 16px 16px;
    	.popup-block-pay{
    		text-align: center;
    		padding:20px;
    		.price-sub-title{
    			font-size:$s-font;
    			color:$g-font-color;
    			line-height: 30px;
    		}
    		.price-big-title{
    			font-size: 22px;
    			color:$theme-color;
    			font-weight:bold;
    			margin-top:10px;
    		}
    	}
    	.popup-label{
    		line-height: 40px;
    		font-size:$m-font;
    		color:$g-font-color;
    		@include flexbox(space-between,center)
    	}
    	.img-div{
    		width:210px;
    		height:210px;
    		border:1px solid $border-color;
    		margin:0 auto;
    		background: #f4f5f7;
    	}
        .send-list{
    		padding-top:$marginSpace;
    		.send-item{
    			border-radius: 8px;
    			padding:12px;
    			box-shadow: 0 0 5px rgba(0,0,0,0.1);
    			margin-bottom:$marginSpace;
    			.send-top{
    				@include flexbox(flex-start,flex-start);
    				font-size:$m-font;
    				.name{
    					padding-right:12px;
    					flex:1
    				}
    				.num{
    					font-weight: bold;
    					color:$theme-color
    				}
    			}
    			.send-middle{
    				font-size:$s-font;
    				color:$g-font-color;
    				line-height: 18px;
    				margin-top:5px;
    			}
    			.send-bottom{
    				text-align: right;
    				font-size:$s-font;
    				margin-top:16px
    			}
    		}
    	}
    	.category-list{
    		padding:36rpx 0;
    		.list-item{
    			@include flexbox(flex-start,flex-start);
    			margin-bottom:20rpx;
    			.item-title{
    				width: 126rpx;
    				height: 52rpx;
    				background: rgba(255,255,255,0.39);
    				border: 1px solid #B8B8B8;
    				border-radius: 9rpx;
    				font-size:$m-font;
    				text-align: center;
    				line-height: 52rpx;
    			}
    			.item-list{
    				padding-left:30rpx;
    				width:calc(100% - 126rpx);
    				overflow: hidden;
    				.item-ename{
    					font-size:$s-font;
    					color: #929292;
    					line-height: 52rpx;
    					width: 170rpx;
    					@include textoverflow(1);
    					float:left;
    				}
    			}
    		}
    	}
    	.goodsSn-list{
    		border: 1px solid #DEDEDE;
    		padding:0 10px;
    		font-size:$s-font;
    		margin-top:15px;
    		padding-bottom:10px;
    		.list-cell{
    			border-bottom:1px solid #DEDEDE;
    			@include flexbox(space-between,center);
    			line-height: 60rpx;
    			height:60rpx;
    		}
    		.list-cell:first-child{
    			
    		}
    	}
    	.audio-text{
    		font-size: 34rpx;
    		line-height: 48rpx;
    		color: #414141;
    		text-align: center;
    		padding-top:100rpx;
    	}
    	.audio-dh{
    		@include flexbox(space-between,center);
    	}
    
    }
    .popup-bottom{
    	background: #fff;
    	margin-top:10px;
    	padding:16px;
    }
    .popup-bottom-fixed{
    	position: fixed;
    	width:100%;
    	padding:16px;
    	box-sizing: border-box;
    	bottom:0
    }
    
    

</style>
